<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查询派工单（根据id）</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.css" rel="stylesheet">
</head>
<body>
<div style="color: #0e9aef">您正在做的业务是：生产管理--内部生产管理--生产查询</div>


<div class="container" style="margin-top: 10px">
    <form class="form-horizontal" id="query_send_work_order_form">
        <div>
            派工单编号：<span id="manufactureId"></span> 其中审核状态：<span id="checkTag"></span>
            <button type="button" class="btn btn-default col-md-offset-7" onclick="history.back(-1);">返回</button>
        </div>
        <div class="panel panel-default" style="margin-top: 5px;">
            <div>

                    <h3 style="margin-top: 30px;text-align: center;">生产派工单</h3>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">产品编号：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="productId" id="productId"
                                   style="border: none;background-color: white"/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">产品名称：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="productName" id="productName"
                                   style="border: none;background-color: white"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">投产数量：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="amount" id="amount"
                                   style="border: none; background-color: white" readonly/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">工单制定人：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="designer" id="designer"
                                   style="border: none; background-color: white" readonly/>
                        </div>
                    </div>
                </div>

                <table id="send_work_order_table"></table>

                <div class="form-group" style="margin-top: 10px;">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">工时总成本：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="labourCostPriceSum" id="labourCostPriceSum"
                                   style="border: none;background-color: white" readonly/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">物料总成本：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="moduleCostPriceSum" id="moduleCostPriceSum"
                                   style="border: none;background-color: white" readonly/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">登记人：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="register" id="register"
                                   style="border: none;background-color: white" readonly/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">登记时间：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="registerTime" id="registerTime"
                                   style="border: none;background-color: white" readonly/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">审核人：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="checker" id="checker"
                                   style="border: none;background-color: white" readonly/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">审核时间：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="checkTime" id="checkTime"
                                   style="border: none;background-color: white" readonly/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-12">
                        <label class="col-md-2 control-label">备注：</label>
                        <div class="col-md-8">
                            <textarea cols="50" rows="3" class="form-control" style="resize: none;background-color: white" id="remark"
                                      name="remark" readonly></textarea>
                        </div>
                    </div>
                </div>
                <input type="hidden" name="id" id="id">
                <input type="hidden" name="applyIdGroup" id="applyIdGroup">
            </div>
        </div>
    </form>
</div>


<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>

<script>
    $(function (){
        let pid=localStorage.getItem("qid")

        $.post("/manufacture/detail/getIdQuery",{"rid":pid},function (res){
            if(res.checkTag=="S001-0"){
                $("#query_send_work_order_form #manufactureId").html(res.manufactureId).css("color","#eea236")
                $("#query_send_work_order_form #checkTag").html("等待").css("color","#eea236")
            }else if(res.checkTag=="S001-1"){
                $("#query_send_work_order_form #manufactureId").html(res.manufactureId).css("color","green")
                $("#query_send_work_order_form #checkTag").html("通过").css("color","green")
            }else {
                $("#query_send_work_order_form #manufactureId").html(res.manufactureId).css("color","red")
                $("#query_send_work_order_form #checkTag").html("未通过").css("color","red")
            }
            $("#query_send_work_order_form #id").val(res.id)
            $("#query_send_work_order_form #productId").val(res.productId)
            $("#query_send_work_order_form #productName").val(res.productName)
            $("#query_send_work_order_form #amount").val(res.amount)
            $("#query_send_work_order_form #designer").val(res.designer)
            $("#query_send_work_order_form #labourCostPriceSum").val(res.labourCostPriceSum)
            $("#query_send_work_order_form #moduleCostPriceSum").val(res.moduleCostPriceSum)
            $("#query_send_work_order_form #register").val(res.register)
            $("#query_send_work_order_form #registerTime").val(formater(res.registerTime))
            $("#query_send_work_order_form #remark").val(res.remark)
            $("#query_send_work_order_form #checker").val(res.checker)
            if(res.checkTime==null){
                $("#query_send_work_order_form #checkTime").val()
            }else{
                $("#query_send_work_order_form #checkTime").val(formater(res.checkTime))
            }
            $("#query_send_work_order_form #applyIdGroup").val(res.applyIdGroup)
        })

        $("#query_send_work_order_form #send_work_order_table").bootstrapTable({
            method: "post",
            contentType: "application/x-www-form-urlencoded",
            url: "/manufacture/detail/getIdQueryDesign",
            // 数据行交替样式
            striped: true,
            // 是否是服务器端分页：server表示服务器端，client表示前端分页
            sidePagination: 'server',
            queryParams: function (params) {
                let obj = {
                    pid: pid
                }
                return obj;
            },
            // 表格列标题
            columns: [{
                title: "序号",
                field: "detailsNumber"
            },{
                title: "工序状态",
                field: "procedureFinishTag",
                formatter:function (value,row,index){
                    if(value=="G004-0"){
                        return "等待"
                    }else if(value=="G004-1"){
                        return "完成"
                    }else if(value=="G004-2"){
                        return "未完成"
                    }else {
                        return "完成"
                    }
                }
            }, {
                title: "工序名称",
                field: "procedureName"
            }, {
                title: "设计工时成本（元）",
                field: "subtotal",
            },{
                title: "实际工时成本（元）",
                field: "realSubtotal",
            }, {
                title: "设计物料成本",
                field: "moduleSubtotal"
            }, {
                title: "实际物料成本",
                field: "realModuleSubtotal"
            }]
        })
    })
</script>
</body>
</html>